<extend name="Public:comment" />

<block name="title">管理评论</block>

<block name="css">
	<link rel="stylesheet" href="/Application/Home/Common/css/base.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_common.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_header.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_manager.css" type="text/css" />
	<link rel="stylesheet" href="/Application/Home/Common/css/shop_shdz_835.css" type="text/css" />
</block>

<block name="js">
	<script type="text/javascript" src="/Application/Home/Common/js/jquery.js" ></script>
    <script type="text/javascript" src="/Application/Home/Common/js/topNav.js" ></script>
    <script type="text/javascript">
    	 //下面用于多图片上传预览功能
    function setImagePreviews(avalue) {
        //获取选择图片的对象
        var docObj = document.getElementById("doc");
        //后期显示图片区域的对象
        var dd = document.getElementById("dd");
        dd.innerHTML = "";
        //得到所有的图片文件
        var fileList = docObj.files;
        //循环遍历
        for (var i = 0; i < fileList.length; i++) {    
            //动态添加html元素        
            dd.innerHTML += "<div style='float:left' > <img id='img" + i + "'  /> </div>";
            //获取图片imgi的对象
            var imgObjPreview = document.getElementById("img"+i); 
            
            if (docObj.files && docObj.files[i]) {
                //火狐下，直接设img属性
                imgObjPreview.style.display = 'block';
                imgObjPreview.style.width = '100px';
                imgObjPreview.style.height = '90px';
                //imgObjPreview.src = docObj.files[0].getAsDataURL();
                //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要以下方式
                imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);   //获取上传图片文件的物理路径
            }
            else {
                //IE下，使用滤镜
                docObj.select();
                var imgSrc = document.selection.createRange().text;
                //alert(imgSrc)
                var localImagId = document.getElementById("img" + i);
               //必须设置初始大小
                localImagId.style.width = "200px";
                localImagId.style.height = "180px";
                //图片异常的捕捉，防止用户修改后缀来伪造图片
                try {
                    localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                    localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
                }
                catch (e) {
                    alert("您上传的图片格式不正确，请重新选择!");
                    return false;
                }
                imgObjPreview.style.display = 'none';
                document.selection.empty();
            }
        }  
        return true;
    }
    </script>
</block>

<block name="shouye">
	<div id="shop_hd_menu_all_category" class="shop_hd_menu_all_category"><!-- 首页去掉 id="shop_hd_menu_all_category" 加上clsss shop_hd_menu_hover -->
</block>

<block name="content">
	<!-- 面包屑 注意首页没有 -->
	<div class="shop_hd_breadcrumb">
		<strong>当前位置：</strong>
		<span>
			<a href="{:U('Index/index')}">首页</a>&nbsp;›&nbsp;
			<a href="{:U('User/member')}">我的商城</a>&nbsp;›&nbsp;
			<a href="">我的地址</a>
		</span>
	</div>
	<div class="clear"></div>
	<!-- 面包屑 End -->

	<!-- Header End -->	

	<!-- 我的个人中心 -->
	<div class="shop_member_bd clearfix">
		<!-- 左边导航 -->
		<div class="shop_member_bd_left clearfix">
			
			<div class="shop_member_bd_left_pic">
				<a href="javascript:void(0);"><img src="/Application/Home/Common/images/avatar.png" /></a>
			</div>
			<div class="clear"></div>

			<dl>
				<dt>我的交易</dt>
				<dd><span><a href="{:U('member')}">已购买商品</a></span></dd>
				<dd><span><a href="{:U('Index/favorite')}">我的收藏</a></span></dd>
				<dd><span><a href="{:U('estimate')}">评价管理</a></span></dd>
			</dl>

			<dl>
				<dt>我的账户</dt>
				<dd><span><a href="{:U('member_info')}">个人资料</a></span></dd>
				<dd><span><a href="{:U('password_edit')}">密码修改</a></span></dd>
				<dd><span><a href="{:U('address')}">收货地址</a></span></dd>
			</dl>

		</div>
		<!-- 左边导航 End -->
		
		<!-- 右边购物列表 -->
		<div class="shop_member_bd_right clearfix">
			
			<div class="shop_meber_bd_good_lists clearfix">
				<div class="title"><h3>编辑地址</h3></div>
				<div class="clear"></div>
			<!-- 收货人地址 Title End -->
			<div class="shop_bd_shdz clearfix">
			<form action="" method="post" enctype="multipart/form-data">
				<table width:600 border="1px" cellpadding:0 style="line-height:25px;text-align:center">
					<tr>
						<td>姓名</td>
						<td>
							<input type="text" name="name" style="width:100%;height:25px;" value="{$address['name']}">
						</td>
					</tr>
					<tr>
						<td>地址</td>
						<td>
							<select style="width:30%;margin-left:0;height:25px;" name="address1" class="select1">
								<option value="{$address['address1']}">{$address['address1']}</option>
								<foreach name="placename" item="v">
									<option value="{$v['id']}" 
									<eq	name="$v['name']" value="$address['address1']">selected</eq>
									>{$v.name}</option>
								</foreach>
							</select>
							<select style="width:30%;margin-left:0;height:25px;" name="address2" class="select2">
								<option value="{$address['address2']}">{$address['address2']}</option>
							</select>
							<select style="width:30%;margin-left:0;height:25px;" name="address3" class="select3">
								<option value="{$address['address3']}">{$address['address3']}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>详细地址</td>
						<td>
							<input type="text" name="address" style="width:100%;height:25px;" value="{$address['address']}">
						</td>
					</tr>
					<tr>
						<td>邮政编码</td>
						<td>
							<input type="text" name="postalcode" style="width:100%;height:25px;" value="{$address['postalcode']}">
						</td>
					</tr>
					<tr>
						<td>电话号码</td>
						<td>
							<input type="text" name="phone" style="width:100%;height:25px;" value="{$address['phone']}">
						</td>
					</tr>
					<tr>
						<td>手机号码</td>
						<td>
							<input type="text" name="mobel_phone" style="width:100%;height:25px;" value="{$address['mobel_phone']}">
						</td>
					</tr>
					<tr>
						<td>操作</td>
						<td>
							<input type="submit" value="确认修改" style="width:100px;height:25px;background:#FE8502;border:none;border-radius:5px;">
							<button  style="width:100px;height:25px;background:red;border:none;border-radius:5px;"><a href="{:U('address')}" style="color:#000">返回</a></button>
						</td>
					</tr>
				</table>
			</form>
			</div>
			<div class="clear"></div>
			</div>
		</div>
		<!-- 右边购物列表 End -->

	</div>
	<!-- 我的个人中心 End -->
	<script type="text/javascript">
		$(function(){
			$(".select1").change(function(){
				var fid = $(this).val();
				console.log(fid);
				$.ajax({
					type:"get",
					url:"{:U('placename')}",
					data:{fid:fid},
					success:function(msg){
						if(msg.status==1){
							$(".select2").html("");
							$(".select2").append(msg.data);
						}
					}
				});
			});

			$(".select2").change(function(){
				var fid = $(this).val();
				console.log(fid);
				$.ajax({
					type:"get",
					url:"{:U('placename3')}",
					data:{fid:fid},
					success:function(msg){
						if(msg.status==1){
							$(".select3").html("");
							$(".select3").append(msg.data);
						}
					}
				});
			});
		});
	</script>
</block>